/**
 * 自定义字段
 */

import request from '@/utils/request'

// 新增自定义字段
export const addNewCustomFields = (data) => {
  return request({
    url: '/v1/field',
    method: 'POST',
    data
  })
}

// 获取字段列表
export const getFieldsList = (params) => {
  return request({
    url: '/v1/field',
    method: 'GET',
    params
  })
}

// 修改自定义字段
export const editField = (params) => {
  return request({
    url: '/v1/field',
    method: 'PUT',
    params
  })
}

// 启用/停用自定义字段
export const enableAndDisableCustomFields = (params) => {
  return request({
    url: '/v1/field/stop',
    method: 'PUT',
    params
  })
}

// 删除自定义字段
export const deleteCustomField = (params) => {
  return request({
    url: '/v1/field',
    method: 'DELETE',
    params
  })
}
